{% extends 'base.html' %}

{% block title %}添加环境数据{% endblock %}

{% block content %}
<div class="card">
    <div class="card-header bg-primary text-white">
        <h4 class="mb-0">添加环境数据</h4>
    </div>
    <div class="card-body">
        <form method="post">
            <div class="row">
                <div class="col-md-6 mb-3">
                    <label for="region" class="form-label">区域</label>
                    <input type="text" class="form-control" id="region" name="region" required>
                </div>
                <div class="col-md-6 mb-3">
                    <label for="date" class="form-label">日期</label>
                    <input type="date" class="form-control" id="date" name="date" required>
                </div>
                <div class="col-md-4 mb-3">
                    <label for="temperature" class="form-label">温度(℃)</label>
                    <input type="number" step="0.1" class="form-control" id="temperature" name="temperature" required>
                </div>
                <div class="col-md-4 mb-3">
                    <label for="rainfall" class="form-label">降雨量(mm)</label>
                    <input type="number" step="0.1" class="form-control" id="rainfall" name="rainfall" required>
                </div>
                <div class="col-md-4 mb-3">
                    <label for="light_intensity" class="form-label">光照强度(lux)</label>
                    <input type="number" step="0.1" class="form-control" id="light_intensity" name="light_intensity" required>
                </div>
                <div class="col-md-6 mb-3">
                    <label for="soil_type" class="form-label">土壤类型</label>
                    <select class="form-select" id="soil_type" name="soil_type" required>
                        <option value="">请选择土壤类型</option>
                        <option value="砂质土">砂质土</option>
                        <option value="壤土">壤土</option>
                        <option value="粘土">粘土</option>
                        <option value="砂壤土">砂壤土</option>
                        <option value="粘壤土">粘壤土</option>
                    </select>
                </div>
                <div class="col-md-6 mb-3">
                    <label for="soil_fertility" class="form-label">土壤肥力</label>
                    <select class="form-select" id="soil_fertility" name="soil_fertility" required>
                        <option value="">请选择土壤肥力</option>
                        <option value="高">高</option>
                        <option value="中">中</option>
                        <option value="低">低</option>
                    </select>
                </div>
            </div>
            <div class="mt-3">
                <button type="submit" class="btn btn-primary">保存</button>
                <a href="{{ url_for('data.environment_list') }}" class="btn btn-secondary">返回</a>
            </div>
        </form>
    </div>
</div>
{% endblock %} 